package org.rsbot.gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.io.File;
import java.net.MalformedURLException;
import javax.swing.ImageIcon;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import org.rsbot.util.GlobalConfiguration;

/**
 * This is the main side panel construction
 * @author Sorcermus
 */
public class ConsolePanel extends JPanel {

    private static final long serialVersionUID = 2951376566864605030L;
    public ToolPanel1 toolPanel1 = null;

    /**
     * This is the default constructor
     */
    public ConsolePanel() {
        JTabbedPane WindowOptions = new JTabbedPane();
        try {
            WindowOptions.setFont(new Font("Futura Md BT", 0, 10));
            PickRewardsGUI pick = new PickRewardsGUI();
            WindowOptions.addTab("Rewards", new ImageIcon(GlobalConfiguration.RUNNING_FROM_JAR
                    ? getClass().getResource(GlobalConfiguration.Paths.Resources.OPTION)
                    : new File(GlobalConfiguration.Paths.OPTION).toURI().toURL()), pick);
        } catch (final MalformedURLException e1) {
        }
        try {
            WindowOptions.setFont(new Font("Futura Md BT", 0, 10));
            ImageFrameDelay image = new ImageFrameDelay();
            WindowOptions.addTab("Image", new ImageIcon(GlobalConfiguration.RUNNING_FROM_JAR
                    ? getClass().getResource(GlobalConfiguration.Paths.Resources.OPTION)
                    : new File(GlobalConfiguration.Paths.OPTION).toURI().toURL()), image);
        } catch (final MalformedURLException e1) {
        }
        try {
            WindowOptions.setFont(new Font("Futura Md BT", 0, 10));
            ItemIDFinderGUI itemID = new ItemIDFinderGUI();
            WindowOptions.addTab("Item ID", new ImageIcon(GlobalConfiguration.RUNNING_FROM_JAR
                    ? getClass().getResource(GlobalConfiguration.Paths.Resources.DEV)
                    : new File(GlobalConfiguration.Paths.DEV).toURI().toURL()), itemID);
        } catch (final MalformedURLException e1) {
        }
        try {
            WindowOptions.setFont(new Font("Futura Md BT", 0, 10));
            NPCIDFinderGUI NPCID = new NPCIDFinderGUI();
            WindowOptions.addTab("NPC ID", new ImageIcon(GlobalConfiguration.RUNNING_FROM_JAR
                    ? getClass().getResource(GlobalConfiguration.Paths.Resources.DEV)
                    : new File(GlobalConfiguration.Paths.DEV).toURI().toURL()), NPCID);
        } catch (final MalformedURLException e1) {
        }
        toolPanel1 = new ToolPanel1(this);
        JPanel panel = new JPanel();
        panel.setPreferredSize(new Dimension(250, 523));
        panel.setMaximumSize(new Dimension(250, 523));
        panel.add(toolPanel1);
        panel.add(WindowOptions);
        add(panel, BorderLayout.NORTH);
    }
}
